import request from "@/utils/request";
import type { AxiosPromise } from "axios";
import type { WfCategory, WfCategoryQuery, WfCategoryVo } from "./type";

// 查询分类列表
export function listWfCategory(query: WfCategoryQuery): AxiosPromise<WfCategoryVo[]> {
  return request({
    url: "/flowable/wfCategory/list",
    method: "get",
    params: query
  });
}

// 查询分类详细
export function getWfCategory(categoryId: string | number): AxiosPromise<WfCategoryVo> {
  return request({
    url: "/flowable/wfCategory/" + categoryId,
    method: "get"
  });
}

// 新增分类
export function addWfCategory(data: WfCategory) {
  return request({
    url: "/flowable/wfCategory",
    method: "post",
    data: data
  });
}

// 修改分类
export function updateWfCategory(data: WfCategory) {
  return request({
    url: "/flowable/wfCategory",
    method: "put",
    data: data
  });
}

// 删除分类
export function delWfCategory(categoryId: string | number | (string | number)[]) {
  return request({
    url: "/flowable/wfCategory/" + categoryId,
    method: "delete"
  });
}
